CROSS_COMPILE = arm-linux-

rootdir = $(prefix)
bindir = $(rootdir)/bin
sbindir = $(rootdir)/sbin

CC = $(CROSS_COMPILE)gcc

TARGET = ldn
SOURCE = main.c

.PHONY: all

all: $(TARGET)

install: all
	if [ ! -d $(bindir) ];\
	then\
		mkdir -p $(bindir);\
	fi
	install -m 755 $(TARGET) $(bindir);

$(TARGET): $(SOURCE)
	$(CC) $^ -o $@ 

.PHONY: clean
clean:
	$(RM) -rf *.o $(TARGET)

